package org.hagopa.games.moneypool.testClient;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.hagopa.games.moneypool.msgs.CommandsEnum;

public class ClientCLI {
	private int _input = 0;
	
	public void welcome()
	{
		System.out.println("Welcome to Protocol Tester\n---------------------------------\n");
		System.out.println("Please type Commnand number , to send to server:");
	}
	
	public void showList()
	{
		CommandsEnum [] list = CommandsEnum.values();
		welcome();
		for(int i = 0; i< list.length; i++)
		{
			if(list[i].getType() == 2)
			{
				System.out.println(list[i].idx() + ") " + list[i].getName());
			}
		}
		System.out.println(" 0) Exit");
		getInput();
	}
	public void getInput()
	{
		InputStreamReader isr = new InputStreamReader( System.in );
	    BufferedReader stdin = new BufferedReader( isr );
	    String input = null;
	    System.out.println(" > ");
	    try {
			input = stdin.readLine();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		this._input = Integer.parseInt(input);
		
	}

	public int get_input() {
		
		return _input;
	}
	
}
